# -*- coding: utf-8 -*-
# -*- author: GXR -*-
import re
import requests


def get_proxy():
    response = requests.get(url='http://www.89ip.cn/tqdl.html?api=1&num=30&port=&address=%E4%B8%AD%E5%9B%BD&isp=')
    data = re.findall("</script>(.*?)效", response.text, re.S)[0]
    data1 = re.findall("</script>(.*?)高", data, re.S)[0].replace('\n', '').split('<br>')[:-1]
    proxy = []
    for i in data1:
        url = 'http://' + i
        proxy.append(url)
    print(proxy)
    return proxy


if __name__ == '__main__':
    get_proxy()
